package com.lantosec.hmrp.modules.sysdata.vo;

import com.lantosec.hmrp.core.mvc.BaseVO;
import com.lantosec.hmrp.modules.sysdata.entity.SysDataModel;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;

/**
 * <p>
 * 系统数据模型定义表 VO对象
 * </p>
 *
 * @author AutoCode
 * @since 2020-03-02
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel(value = "SysDataModel对象", description = "系统数据模型定义表")
public class SysDataModelVO extends BaseVO<SysDataModel> {
    private static final long serialVersionUID = 1L;
    @ApiModelProperty(value = "数据模型ID")
    private String dataModelId;
    @ApiModelProperty(value = "数据模型名称")
    private String dataModelName;
    @ApiModelProperty(value = "数据库名")
    private String databaseName;
    @ApiModelProperty(value = "表名")
    private String tableName;
    @ApiModelProperty(value = "对应的服务类名")
    private String serviceName;
    @ApiModelProperty(value = "创建时间")
    private Date createTime;
    @ApiModelProperty(value = "最后编辑时间")
    private Date editTime;

    public SysDataModelVO(SysDataModel entity) {
        this.dataModelId = entity.getDataModelId();
        this.dataModelName = entity.getDataModelName();
        this.databaseName = entity.getDatabaseName();
        this.tableName = entity.getTableName();
        this.serviceName = entity.getServiceName();
        this.createTime = entity.getCreateTime();
        this.editTime = entity.getEditTime();
    }

    @Override
    public SysDataModel convertToEntity() {
        return new SysDataModel(this);
    }


}
